<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib  prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<c:set var="ctx" value="${pageContext.request.contextPath }"/>
<!DOCTYPE html>
<html lang="en" class="no-js">
<head>
	<meta charset="utf-8" />
	<title>低值资产管理系统</title>
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta content="width=device-width, initial-scale=1.0" name="viewport" />
	<meta content="" name="description" />
	<meta content="" name="author" />
	<meta name="MobileOptimized" content="320">
	<!-- BEGIN GLOBAL MANDATORY STYLES -->
	<link href="${ctx}/assets/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css"/>
	<link href="${ctx}/assets/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
	<link href="${ctx}/assets/plugins/uniform/css/uniform.default.css" rel="stylesheet" type="text/css"/>
	<!-- END GLOBAL MANDATORY STYLES -->	
	<!-- BEGIN THEME STYLES --> 
	<link href="${ctx}/assets/css/style-metronic.css" rel="stylesheet" type="text/css"/>
	<link href="${ctx}/assets/css/style.css" rel="stylesheet" type="text/css"/>
	<link href="${ctx}/assets/css/style-responsive.css" rel="stylesheet" type="text/css"/>
	<link href="${ctx}/assets/css/plugins.css" rel="stylesheet" type="text/css"/>
	<link href="${ctx}/assets/css/pages/tasks.css" rel="stylesheet" type="text/css"/>
	<link href="${ctx}/assets/css/themes/light.css" rel="stylesheet" type="text/css"/>
	<link href="${ctx}/assets/css/custom.css" rel="stylesheet" type="text/css"/>
	<link href="${ctx}/css/custom.css" rel="stylesheet" type="text/css"/>

	<link rel="stylesheet" type="text/css" href="${ctx}/assets/plugins/select2/select2_metro.css" />
	<link rel="stylesheet" href="${ctx}/assets/plugins/data-tables/DT_bootstrap.css" />
	
	<link href="${ctx}/assets/plugins/bootstrap-modal/css/bootstrap-modal-bs3patch.css" rel="stylesheet" type="text/css"/>
	<link href="${ctx}/assets/plugins/bootstrap-modal/css/bootstrap-modal.css" rel="stylesheet" type="text/css"/>
	<!-- END THEME STYLES -->
	<link rel="shortcut icon" href="favicon.ico" />
	<style type="text/css">
		.page-content{
			min-height:900px;
		}
	</style>
</head>
<body class="page-header-fixed">
	<!-- BEGIN HEADER -->
	<%@include file="../include/header.jsp" %>
	<!-- END HEADER -->
	<div class="clearfix"></div>
	<!-- BEGIN CONTAINER -->
	<div class="page-container">
		<!-- BEGIN SIDEBAR -->
		<%@include file="../include/sidebar.jsp" %>
		<!-- END SIDEBAR -->
		<!-- BEGIN PAGE -->
		<div class="page-content">			
			<div class="row">
				<div class="col-md-12">
					<!-- BEGIN PAGE TITLE & BREADCRUMB-->
					<h3 class="page-title">
						物资退还流程
					</h3>
					
					<!-- END PAGE TITLE & BREADCRUMB-->
				</div>
			</div>
			<!-- END PAGE HEADER-->
			<!-- BEGIN PAGE CONTENT-->
			<div class="row">
				<div class="col-md-12">
					<!-- BEGIN TAB PORTLET-->   
					<div class="portlet box green tabbable">
						<div class="portlet-title">
							<div class="caption"><i class="fa fa-reorder"></i>退还流程待办</div>
						</div>
						<div class="portlet-body">
							<div class=" portlet-tabs">
								<ul class="nav nav-tabs">									
									<c:if test="${not empty tuiHuiList}"><li class="active"><a href="#portlet_tab0" data-toggle="tab">退还接收</a></li></c:if>
								</ul>
								<div class="tab-content">
									<div class="tab-pane <c:if test="${not empty tuiHuiList}">active</c:if>" id="portlet_tab0">
										<div class="portlet-body">
											<form method="POST" id="thqrForm">
												<c:if test="${not empty tuiHuiList }">
													<div style="text-align:right;">
														<a class="btn blue" id="thqrPiSubmit"><i class="fa fa-search"></i>&nbsp;&nbsp;批量接收</a>&nbsp;&nbsp;
														<a class="btn red" id="boHuiPL"><i class="fa fa-search"></i>&nbsp;&nbsp;批量驳回</a>
													</div>
												</c:if>
												<div class="table-scrollable">
													<table class="table table-striped table-bordered table-hover" id="sample_1">
														<thead>
															<tr>
																<th><input type="checkbox" id="thqrSelectAll"></th>
																<th>申请日期</th>
																<th>退还原因</th>
																<th>资产编号</th>
																<th>物资名称</th>
																<th>品牌</th>
																<th>规格型号</th>
																<th>产品序列号</th>
																<th>查看</th>																						
																<th>操作</th>
															</tr>
														</thead>
														<tbody id="thqr">												
														</tbody>
													</table>
												</div>
											</form>
										</div>
									</div>
								</div>								
							</div>
						</div>
					</div>					
				</div>
			</div>
			
			<!-- END PAGE CONTAINER-->			
		</div>
		<!-- END PAGE -->
	</div>
	<!-- END CONTAINER -->
	<!-- BEGIN FOOTER -->
	<%@include file="../include/footer.jsp" %>
	<!-- END FOOTER -->
	<!-- BEGIN JAVASCRIPTS(Load javascripts at bottom, this will reduce page load time) -->
	<!-- BEGIN CORE PLUGINS -->   
	<!--[if lt IE 9]>
	<script src="${ctx}/assets/plugins/respond.min.js"></script>
	<script src="${ctx}/assets/plugins/excanvas.min.js"></script> 
	<![endif]-->   
	<script src="${ctx}/assets/plugins/jquery-1.10.2.min.js" type="text/javascript"></script>
	<script src="${ctx}/assets/plugins/jquery-migrate-1.2.1.min.js" type="text/javascript"></script>   
	<!-- IMPORTANT! Load jquery-ui-1.10.3.custom.min.js before bootstrap.min.js to fix bootstrap tooltip conflict with jquery ui tooltip -->
	<script src="${ctx}/assets/plugins/jquery-ui/jquery-ui-1.10.3.custom.min.js" type="text/javascript"></script>
	<script src="${ctx}/assets/plugins/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
	<script src="${ctx}/assets/plugins/bootstrap-hover-dropdown/twitter-bootstrap-hover-dropdown.min.js" type="text/javascript" ></script>
	<script src="${ctx}/assets/plugins/jquery-slimscroll/jquery.slimscroll.min.js" type="text/javascript"></script>
	<script src="${ctx}/assets/plugins/jquery.blockui.min.js" type="text/javascript"></script>  
	<script src="${ctx}/assets/plugins/jquery.cookie.min.js" type="text/javascript"></script>
	<script src="${ctx}/assets/plugins/uniform/jquery.uniform.min.js" type="text/javascript" ></script>
	<!-- END CORE PLUGINS -->
	
	<!-- IMPORTANT! fullcalendar depends on jquery-ui-1.10.3.custom.min.js for drag & drop support -->
	<script src="${ctx}/assets/plugins/fullcalendar/fullcalendar/fullcalendar.min.js" type="text/javascript"></script>
	<script src="${ctx}/assets/plugins/jquery-easy-pie-chart/jquery.easy-pie-chart.js" type="text/javascript"></script>
	<script src="${ctx}/assets/plugins/jquery.sparkline.min.js" type="text/javascript"></script>  
	<!-- END PAGE LEVEL PLUGINS -->
	<!-- BEGIN PAGE LEVEL SCRIPTS -->
	<script src="${ctx}/assets/scripts/app.js" type="text/javascript"></script>
	<script src="${ctx}/assets/scripts/index.js" type="text/javascript"></script>
	<script src="${ctx}/assets/scripts/tasks.js" type="text/javascript"></script>

	<script type="text/javascript" src="${ctx}/assets/plugins/select2/select2.min.js"></script>
	<script src="${ctx}/assets/plugins/bootstrap-modal/js/bootstrap-modalmanager.js" type="text/javascript" ></script>
	<script src="${ctx}/assets/plugins/bootstrap-modal/js/bootstrap-modal.js" type="text/javascript" ></script>
	<script src="${ctx}/assets/scripts/table-advanced.js?t=202004022058"></script>
	<!-- END PAGE LEVEL SCRIPTS -->
	<script>
		jQuery(document).ready(function() {    
		   App.init(); // initlayout and core plugins
		   $('#A').addClass("active");
		   $('#A4').addClass('active');
		   TableAdvanced.init();
		   $.ajax({
				type:"GET",
				url:"${ctx}/wuzi/thqrListAjax.do",
				dataType:"html",
				success:function(data){
					$('#thqr').html(data);
				}
			});
		});
		
		var tuiHuanQueRen=function(id){
			$.ajax({
				type:"GET",
				url:"${ctx}/wuzi/tuiHuanQueRen.do?id="+id,
				dataType:"json",
				async:false,
				success:function(data){
					if(data.result=="success"){
						alert('退还接收确认！');
						window.location.reload();
					}
				}
			});
		}
		
		var weiXiuRZ=function(id){
			$.ajax({
				type:"GET",
				url:"${ctx}/wuzi/weiXiuRZ.do?id="+id,
				dataType:"json",
				async:false,
				success:function(data){
					if(data.result=="success"){
						alert('维修入账！');
						window.location.reload();
					}
				}
			});
		}
		
		var weiXiuHuanHuoTY=function(id){
			$.ajax({
				type:"POST",
				data:{
					"id":id
				},
				url:"${ctx}/wuzi/weiXiuHuanHuoTY.do",
				dataType:"json",
				async:false,
				success:function(data){
					if(data.result=="success"){
						alert("您选择同意换货");
						window.location.reload();						
					}else{
						alert("审批不成功");
					}
				}
			});
		}
		
		$('#thqrSelectAll').click(function(){
			if($('#thqrSelectAll').attr("checked")){
				$("input[name='thqrId']:checkbox").prop("checked",true);
			}else{
				$("input[name='thqrId']:checkbox").prop("checked",false);				
			}			
		});
		
		$('#thqrPiSubmit').click(function(){
			$.ajax({
				type:"POST",
				data:$('#thqrForm').serialize(),
				url:"${ctx}/wuzi/thqrPiSubmit.do",
				dataType:"json",
				async:false,
				success:function(data){
					$.ajax({
						type:"POST",
						url:"${ctx}/wuzi/thqrListAjax.do",
						dataType:"html",
						success:function(data){
							$("#thqr").html(data);
						}
					});
				}
			});
		});
		
		$('#boHuiPL').click(function(){
			$.ajax({
				type:"POST",
				data:$('#thqrForm').serialize(),
				url:"${ctx}/wuzi/thjsPL.do",
				dataType:"json",
				async:false,
				success:function(data){
					if(data.result=="none"){
						alert("未选择审批内容！");
					}else{
						$('#thqrForm').attr("action", "${ctx}/wuzi/thjsBHPL.do").attr("target","_blank").submit();
					}
				}
			});
		});
	</script>
	<!-- END JAVASCRIPTS -->
</body>
<!-- END BODY -->
</html>